let testCfg = {
  //IP:"127.0.0.1",
   IP: "192.168.1.218",
  //  IP: "192.168.119.113",
  PORT: 8080,
};
let cfg = {
  DEV: MYDEV, // test || produce
  HEADERS: {"Content-type": "application/json;charset=UTF-8"},
  PAGECOUNT: 20,
  MENUDIC: {
    "/user/menu/loginPage": {
      resource_name: "登录信息",
      path: "/page11"
    }
  },
  tenentRoot: "/tenant",
  adminUserType: "1",
  STORAGE_KEYS: ['token','dataCenterId','user_id','user_name','user_type','checkPass','page336','page318', 'page212_role', 'page42_tenantArray', 'dataCenterId','page42_butShow'],
  TEBABT_RESOURCE_HIVE_CATALOG: '/apps/hive/warehouse/',
  CONNECTOR: ' -- ',
  RESPONSE_WORK_BOOK: {
    200: {
      tips: "操作成功",
      type: "success"
    },
    400: {
      tips: "系统错误",
      type: "error"
    },
    401: {
      tips: "鉴权失败",
      type: "error"
    },
    402: {
      tips: "token错误",
      type: "error"
    },
    403: {
      tips: "用户无权限",
      type: "error"
    },
    404: {
      tips: "未找到",
      type: "error"
    },405: {
      tips: "http请求头，数据中心参数不能为空",
      type: "error"
    },
    40001: {
      tips: "Ldap系统错误",
      type: "error"
    },
    40001001: {
      tips: "Ldap鉴权失败",
      type: "error"
    },
    40002: {
      tips: "ranger系统错误",
      type: "error"
    },
    40002001: {
      tips: "ranger资源不存在",
      type: "error"
    },
    40003: {
      tips: "大数据系统错误",
      type: "error"
    },
    40003101: {
      tips: "hdfs资源无权限访问",
      type: "error"
    },
    40003301: {
      tips: "hivesql执行错误",
      type: "error"
    },
    40004: {
      tips: "管理平台代理平台错误",
      type: "error"
    },
    40004001: {
      tips: "管理平台任务运行错误",
      type: "error"
    },
    5000104: {
      tips: "用户已存在",
      type: "error"
    },
    5000105: {
      tips: "用户名、密码、或验证码错误，请重试",
      type: "error"
    },
    5000106: {
      tips: "用户名、密码、或验证码错误，请重试",
      type: "error"
    },
    5000107: {
      tips: "任务信息更新任务错误",
      type: "error"
    },
    5000111: {
      tips: "角色已经绑定用户",
      type: "error"
    },
    5000112: {
      tips: "角色拥有策略",
      type: "error"
    },
    5000204: {
      tips: "请求参数错误",
      type: "error"
    },
    500601: {
      tips: "默认数据库",
      type: "error"
    },
    500602: {
      tips: "数据库存在",
      type: "error"
    },
    500603: {
      tips: "表已经存在",
      type: "error"
    },
    500701:{
      tips: "路径已经存在",
      type: "error"
    },500801:{
      tips: "HBASE 命名空间已经存在",
      type: "error"
    },500901:{
      tips: "KAFKA topic已经存在",
      type: "error"
    },501001:{
      tips: "YANR上队列已经存在",
      type: "error"
    },601000:{
      tips: "任务模板名称已经存在",
      type: "error"
    },601001:{
      tips: "任务模板正在运行",
      type: "error"
    },701000:{
      tips: "任务组名已绑定任务模板",
      type: "error"
    },
  },

  CMSZ_PUB: `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn9NL47u+vQAE0+ULYFhs
gP79xk+cqHw48fZ5f0UVxc+iwPVHoMHXJ7g7eoKF05ZtMFhKFrjtsTRYm4CX/j5o
hko0eXCyyWfKk/O7sPhUnt1xwitc7sU0uy1Jd4umVRix10qui7QFIsQExMbIwrS+
IB19WaXVA1zlCyBrcZLXq1CxBfFFnylFfHQYYeWqDBtfczVWAicw2spI7ZwjAdXI
pueGdO5ihlMqqueO4VRXWqCXOsiy6wrN0sKaJFksGuR6awByumMwgt7bwVZpe2//
NHLLwz4KRB840LU5KmXZtScAdQ6qlRX16JJnQPwNO0MqRNP8sdNxlJ3ZvpJolqp7
ZwIDAQAB`,

};
let proCfg = {
  IP: window.location.hostname,
  PORT: window.location.port,
};
if (cfg.DEV == "test") objs2obj(cfg, testCfg);
else objs2obj(cfg, proCfg);
function objs2obj(objA, objB) {
  for (let k in objB)objA[k] = objB[k]
  return objA;
}
cfg.APIURL = `http://${cfg.IP}:${cfg.PORT}/`;
export default cfg
